@extends('WShop::layout')
@push('styles')
<link rel="stylesheet" type="text/css" href="{{asset(config('view.frontend.wap_login').'/lottery/common/css/common_mobile_index.css')}}">
<!-- 移动端适配-->
<script>
    var html = document.querySelector('html');
    changeRem();
    window.addEventListener('resize', changeRem);

    function changeRem() {
        var width = html.getBoundingClientRect().width;
        //console.log( width );
        html.style.fontSize = width / 10 + 'px';
    }
</script>
<style type="text/css">
    .layui-m-layerchild h3 {margin-top: 0px;}
</style>
@endpush
@section('content')
    <div class="mui-content mui-scroll-wrapper" id="pullrefresh">
        <div class="mui-scroll">
{{--            <header class="mui-bar  index-header" style="background: #f3f3f3;">--}}
{{--                <div class="mui-input-row mui-search" id="searchForm">--}}
{{--                    <input type="search" id="searchInput" onkeyup="enterSearch(event)" class="mui-input-clear" placeholder="搜你想要的东西">--}}
{{--                </div>--}}
{{--            </header>--}}
            <div class="mui-table-view mui-table-view-chevron mui-index-swiper ">

                <div class="swiper-container">
                    <div class="swiper-wrapper">
                        @foreach($slides as $slide)
                        <div class="swiper-slide"><img src="{{$slide->img_url}}" /></div>
                        @endforeach
                    </div>

                </div>
                <div class="mui-index-remen mui-bottom">
                    <div class="mui-zhuanqu">
                        <div class="flex ">



                            <div class="flex-item ">
                                <a  href="{{route('f_Wap_Goods_goodsList',['zone'=>1])}}">
                                    <img src="{{asset(config('view.frontend.wap_login').'/images/xianjinqu.png')}}"  alt="" width="45" height="45" />
                                    <p>{{config('shop.zone')[1]}}</p>
                                </a>
                            </div>
                            <div class="flex-item ">
                                <a href="{{route('f_Wap_Goods_goodsList',['zone'=>2])}}">
                                    <img src="{{asset(config('view.frontend.wap_login').'/images/jifenqu.png')}}" alt="" width="45" height="45" />
                                    <p>{{config('shop.zone')[2]}}</p>

                                </a>
                            </div>

                        </div>
                    </div>
                    <div class="mui-zhuanqu">
                        <div class="flex ">



                            <div class="flex-item ">
                                <a  href="javascript:void(0)">
                                    <img src="{{asset(config('view.frontend.wap_login').'/images/home1.png')}}"  alt="" width="45" height="45" />
                                    <p>中安商城</p>
                                </a>
                            </div>
                            <div class="flex-item ">
                                <a  href="javascript:alert('开发中。。。')">
                                    <img src="{{asset(config('view.frontend.wap_login').'/images/home1.png')}}"  alt="" width="45" height="45" />
                                    <p>景区预约</p>
                                </a>
                            </div>
                            <div class="flex-item ">
                                <a  href="javascript:alert('开发中。。。')">
                                    <img src="{{asset(config('view.frontend.wap_login').'/images/home3.png')}}"  alt="" width="45" height="45" />
                                    <p>视频直播</p>
                                </a>
                            </div>

                        </div>
                        <div class="flex ">

                            <div class="flex-item ">
                                <a  href="javascript:alert('开发中。。。')">
                                    <img src="{{asset(config('view.frontend.wap_login').'/images/home4.png')}}"  alt="" width="45" height="45" />
                                    <p>违章查询</p>
                                </a>
                            </div>

                            <div class="flex-item ">
                                <a  href="{{route('f_Wap_Article_Detail',['type'=>1,'id'=>14])}}">
                                    <img src="{{asset(config('view.frontend.wap_login').'/images/home5.png')}}"  alt="" width="45" height="45" />
                                    <p>会员章程</p>
                                </a>
                            </div>
                            <div class="flex-item ">
                                <a  href="{{route('f_Wap_User_index')}}">
                                    <img src="{{asset(config('view.frontend.wap_login').'/images/home6.png')}}"  alt="" width="45" height="45" />
                                    <p>会员登陆</p>
                                </a>
                            </div>

                        </div>
                    </div>
                    @if($article_infos->isNotEmpty())
                    <div class="cms-title br br-b" style="margin-bottom:10px;line-height: 55px;">
                        <div style="width:70px;text-align:center;background-color: #F76029;margin: 10px;line-height:25px;border-radius: 10px;font-size:14px;height:25px;color:white;display:inline-block">
                            最新资讯
                        </div>
                        <p style="padding-left:5px;font-weight: 100;color: lightgrey">|</p>
                        <div class="hot_r" id="hot">
                            <ul id="hot_ul" style="margin-top: 0px;">
                                @foreach($article_infos as $article_item)
                                <li>
                                    <p class="hot-text" style="overflow: hidden">
                                        <a href="{{route('f_Wap_Article_Detail',['type'=>1,'id'=>$article_item['id']])}}">
                                           {{$article_item['title']}}</a></p>
                                </li>
                                 @endforeach
                            </ul>
                        </div>
                        <a href="{{route('f_Wap_Article_Index',['type'=>1])}}">.&nbsp;.&nbsp;.&nbsp;</a>
                    </div>
                   @endif

                    @if($notice_into)
                    <div class="cms-title br br-b" style="margin-bottom:10px;">
                        <div style="width:70px;text-align:center;background-color: #F76029;margin: 10px;line-height:25px;border-radius: 10px;font-size:14px;height:25px;color:white;display:inline-block">
                            系统公告
                        </div>
                        <p style="padding-left:5px;font-weight: 100;color: lightgrey">|</p>
                        <div class="hot_r" id="hot1">
                            <ul id="hot_ul1" style="margin-top: -11.7279px;">

                                <li>
                                    <p class="hot-text" style="overflow: hidden"><a href="{{route('f_Wap_Article_Detail',['type'=>2,'id'=>$notice_into['id']])}}">
                                            <b style=" color: red; ">[紧急]</b>
                                            &nbsp;{{$notice_into['title']}}</a></p>
                                </li></ul>
                        </div>
                        <a href="{{route('f_Wap_Article_Index',['type'=>2])}}">.&nbsp;.&nbsp;.&nbsp;</a>
                    </div>
                    @endif

                    @if($goods->isNotEmpty())
                        <div class="mui-zhuda">
                        <div class="mui-zhuda-title bg-fff mui-text-center">
                            <span class="xian"></span>
                            <div class="main">
                                <i class="i1"></i><i class="i2"></i><p>热销产品</p><i class="i2"></i><i class="i1"></i>
                            </div>
                        </div>
                        <div class="mui-zhuanda-list">
                            <ul class="mui-list-unstyled mui-clearfix">
                                @foreach($goods as $item)
                                <li>
                                    <div class="bg-fff">
                                        <img src="{{str2arr($item->goods_images)[0]}}" alt="" />
                                        <p class=" mui-ellipsis mui-text-center">{{$item->goods_name}}</p>
                                        <span class="color"><b>￥</b>@if($level > 0){{$item->vip_price}}@else{{$item->price}}@endif
                                         <a href="{{route('f_Wap_Goods_goodsDetail',['goods_id'=>$item->goods_id])}}" class="mui-pull-right mui-btn">立即抢购</a>
                                        </span>
                                    </div>
                                </li>
                                @endforeach
                            </ul>
                        </div>
                    </div>
                     @endif
                </div>
            </div>
        </div>
    </div>


    <div id="can_cj" style="display: none;">
        <div class="blin"></div>
        <div class="caidai"></div>
        <div class="winning reback">
            <div class="red-head"></div>
            <div class="red-body"></div>
            <div id="card" class="pull">
                <a href="#" target="_self" class="win"></a>
            </div>
            <a href="{{route('f_wap_lottery_goldegg')}}" target="_self" class="btn"></a>
            <span id="close"></span>
        </div>
    </div>

    @include('WShop::public.foot_bar')
@endsection
@push('scripts')
    <script type="text/javascript" charset="utf-8">
        function enterSearch(event){
            if(event.keyCode == 13) {//用户点击回车的事件号为13
                var keyword = document.getElementById('searchInput').value;
                window.location.href= "{{route('f_Wap_Goods_search')}}?keyword="+keyword;
            }
        }
    </script>
    <script>
        var swiper = new Swiper('.swiper-container', {
            pagination: '.swiper-pagination',
            autoplay:3000,
            paginationClickable: true,

        });
    </script>

<script>
    $(function(){
        setInterval('autoScroll("#hot", "#hot_ul")',2000);
        setInterval('autoScroll("#hot1", "#hot_ul1")',2000);
    })

    function autoScroll(obj, ul_bz){
        $(obj).find(ul_bz).animate({
            marginTop : "-30px"
        },1000,function(){
            $(this).css({marginTop : "0px"}).find("li:first").appendTo(this);
        });
    }

</script>

<script>
    {{--$(function () {--}}
        {{--var remind = parseInt("{{$remind}}");--}}

        {{--if (remind == 1) {--}}
            {{--var text = "平台赠送{{get_rule('reg_give_score')}} {{get_currency()['money2']}}";--}}
            {{--layer.open({--}}
                {{--title: [--}}
                    {{--'温馨提示',--}}
                    {{--'background-color:#8DCE16; color:#fff;'--}}
                {{--],--}}
                {{--content: text,--}}
                {{--btn: '我知道了',--}}
                {{--shadeClose: false,--}}
                {{--yes: function(){--}}
                    {{--window.location.href="{{route('f_Wap_user-giveBonus')}}";--}}
                {{--}--}}
            {{--});--}}
        {{--}--}}
    {{--})--}}
</script>

    <script>
        var can_cj_times={{$can_cj_times}};
        if(can_cj_times==1){
            var $mask = $("#can_cj"),//红包遮罩层
                $winning = $(".winning"),//红包
                $card = $("#card"),
                $close = $("#close");

            //遮罩层显示
            $mask.show();
            $winning.addClass("reback");
            setTimeout(function () {
                $card.addClass("pull");
            }, 500);

            //关闭弹出层
            $("#close,.win,.btn").click(function () {
                //$close.click(function () {
                $mask.hide();
                $winning.removeClass("reback");
                $card.removeClass("pull");
            });
        }



    </script>
    @endpush